package 力扣._00周赛._429周赛.问题1;

import java.util.HashSet;
import java.util.Set;

class Solution {
    public int minimumOperations(int[] nums) {
        Set<Integer> set = new HashSet<>();
        int n = nums.length;
        for(int i=n-1; i>=0; i--){
            if(!set.contains(nums[i])){
                set.add(nums[i]);
            }else{
                // 将0，到 i的全部移除
                int t = i +1;
                int count = (t +2)/3;
                return count;
            }
        }
        return 0;
        
    }
}